home *** CD-ROM | disk | FTP | other *** search
- #define kBaseResID 128
- #define kMoveToFront (WindowPtr)-1L
-
-
- /***************/
- /* Functions */
- /***************/
-
- void ToolBoxInit( void );
- void WindowInit( void );
- void DrawMyPicture( void );
-
-
- /****************** main ***************************/
-
- void main( void )
- {
- ToolBoxInit();
- WindowInit();
-
- DrawMyPicture();
-
- while ( !Button() ) ;
- }
-
-
- /****************** ToolBoxInit *********************/
-
- void ToolBoxInit( void )
- {
- InitGraf( &thePort );
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs( nil );
- InitCursor();
- }
-
-
- /****************** WindowInit ***********************/
-
- void WindowInit( void )
- {
- WindowPtr window;
-
- window = GetNewWindow( kBaseResID, nil, kMoveToFront );
-
- if ( window == nil )
- {
- SysBeep( 10 ); /* Couldn't load the WIND resource!!! */
- ExitToShell();
- }
-
- ShowWindow( window );
- SetPort( window );
- }
-
-
- /****************** DrawMyPicture ********************/
-
- void DrawMyPicture( void )
- {
- Rect pictureRect;
- PicHandle picture;
-
- picture = GetPicture( kBaseResID );
-
- if ( picture == nil )
- {
- SysBeep( 10 ); /* Couldn't load the PICT resource!!! */
- ExitToShell();
- }
-
- pictureRect = (**picture).picFrame;
-
- OffsetRect( &pictureRect, - pictureRect.left,
- - pictureRect.top );
-
- DrawPicture( picture, &pictureRect );
-
- FrameRect( &pictureRect );
- }
-